﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BILLManager.Library.BILLManager.Library.DAL
{
    public class UserDAL : IDisposable
    {

        private dbBillsEntities entities;


        #region Implement IDisposable

        // Basic implementation of IDisposable.
        // This ensures that ObjectContext is disposed of correctly.

        /// <summary>
        /// Track whether Dispose has been called
        /// </summary>
        private bool disposed;

        /// <summary>
        /// Implement Dispose from IDisposable
        /// </summary>
        void IDisposable.Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        /// <summary>
        /// Do the Dispose logic
        /// </summary>
        /// <param name="disposing">true if called from Dispose, false if called from finalizer</param>
        private void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    if (entities != null) entities.Dispose();
                }
                disposed = true;
            }
        }

        /// <summary>
		/// Finalizer
		/// </summary>
        ~UserDAL()
		{
			Dispose(false);
		}

        #endregion

        
    }
}
